#ifndef ECOMMANDMANAGER_H 
#define ECOMMANDMANAGER_H 1

#include <iostream>
#include <deque>
#include <map>
#include <stack>
#include <vector>
#include <DefineLibCommon.h>
#include <DefineCommon.h>
#include <ECommand.h>
#include <ECommandHandler.h>
#include <EController.h>

struct ECommandManagerData;
typedef EDelegate(void (EController::*)(const ECommandPtr& )) ECommandDelegate;
class COMMON_DLL ECommandManager
{
public:
    ~ECommandManager();
    static ECommandManager* instance();

    void processECommand();

    void processECommandUndoOnce();
    void processECommandRedoOnce();

    void pushECommand(ECommandPtr event);

    void registDelegate( ECommandDelegate e);

protected:
    //TODO: the plan of command type str formulate should be maked in the future 
    ECommandManagerData* m_data;

private:
    ECommandManager();

    static ECommandManager * m_instance;
};
#endif // !
